import hrRequest from '../index';
import { IAccount, IDataType, ILoginResult } from './types';
enum LoginAPI {
  AcountLogin = '/login',
  UserInfo = '/users/',
  MenusInfo = '/menu/'
}
//发送登录请求
export function accountLoginRequset(account: IAccount) {
  return hrRequest.post<IDataType<ILoginResult>>({
    url: LoginAPI.AcountLogin,
    data: account
  });
}
//请求用户信息
export function userInfoRequest(id: number) {
  return hrRequest.get<IDataType>({
    url: LoginAPI.UserInfo + id
  });
}
//请求菜单数据
export function menusRequest(id: number) {
  return hrRequest.get<IDataType>({
    url: LoginAPI.MenusInfo + id
  });
}
